// uno.config.ts
import {
  defineConfig,
  presetAttributify,
  presetIcons,
  presetTypography,
  presetUno,
  presetWebFonts,
  transformerDirectives,
  transformerVariantGroup,
} from "unocss";

export default defineConfig({
  // shortcuts: [
  //   // ...
  // ],
  // theme: {
  //   colors: {
  //     // ...
  //   },
  // },
  presets: [
    presetUno(),
    presetAttributify(),
    presetIcons(),
    presetTypography(),
    presetWebFonts({
      fonts: {
        // ...
      },
    }),
  ],
  // rules:[],
  variants: [
    (matcher) => {
      // 支持 hover-items 样式
      if (!matcher.startsWith("hi:")) return matcher;
      return {
        matcher: matcher.slice(3),
        selector: (s) =>
          `.hover-items:hover ${s.replace(/^(\W)?hi\\?\:/gi, "$1")}`,
      };
    },
  ],
  transformers: [transformerDirectives(), transformerVariantGroup()],
});
